package com.magicsoft.share.presenter.my;

import android.util.Log;

import com.magicsoft.share.base.BasePresenter;
import com.magicsoft.share.base.BaseView;
import com.magicsoft.share.bean.my.LoginShareBean;
import com.magicsoft.share.constant.APIService;
import com.magicsoft.share.constant.SPKey;
import com.magicsoft.share.rx_retrofit_network.location.retrofit.RetrofitUtil;
import com.magicsoft.share.rx_retrofit_network.location.rxandroid.NetWorkTransformer;
import com.magicsoft.share.rx_retrofit_network.location.rxandroid.SimpleObserver;
import com.magicsoft.share.utils.SPUtils;
import com.magicsoft.share.view.my.ILoginShareView;

/**
 * Created by fujie on 2018/5/2.
 */

public class LoginSharePersenter extends BasePresenter<ILoginShareView> implements BaseView {
    public void loginshare(){
        RetrofitUtil.getApi(APIService.class)
                .loginShare(SPUtils.getInstance().getString(SPKey.TOKEN),"")
                .compose(new NetWorkTransformer<LoginShareBean>())
                .subscribe(new SimpleObserver<LoginShareBean>(mCompositeDisposable) {
                    @Override
                    public void call(LoginShareBean s) {
                        getView().loginShare(s);
                        Log.e("SSS",s.toString());
                    }
                });
    }
}
